Reduce tmem complaints per Jan's concerns in this thread
http://lists.xensource.com/archives/html/xen-devel/2010-01/msg00155.html
Now complains only if tmem HAS memory to relinquish and
memory request has order>0.
Signed-off by: Dan Magenheimer <dan.magenheimer@oracle.com>
ret = tmemc_set_var(op->u.ctrl.cli_id,subop,op->u.ctrl.arg1);
break;
case TMEMC_QUERY_FREEABLE_MB:
- ret = tmh_freeable_mb();
+ ret = tmh_freeable_pages() >> (20 - PAGE_SHIFT);
break;
case TMEMC_SAVE_BEGIN:
case TMEMC_RESTORE_BEGIN:
unsigned long evicts_per_relinq = 0;
int max_evictions = 10;
- if (!tmh_enabled())
+ if (!tmh_enabled() || !tmh_freeable_pages())
return NULL;
#ifdef __i386__
return NULL;
return tmh_mempool_maxalloc;
}
-static inline unsigned long tmh_freeable_mb(void)
+static inline unsigned long tmh_freeable_pages(void)
{
- return (tmh_avail_pages() + _atomic_read(freeable_page_count)) >>
- (20 - PAGE_SHIFT);
+ return tmh_avail_pages() + _atomic_read(freeable_page_count);
}
static inline unsigned long tmh_free_mb(void)